function configEditCtrl($http, $scope, $route, $rootScope, $timeout, commonService, $location) {
    
    $scope.fieldData = {};
    
    var param = $location.search();
    var url = 'configure_ws.php';
    var name  = '';
    
    if(param['name']){
	name = param['name'];
        var params = {
           'wsname' : 'getconfigurebyname',
           'name'  : name,
           'token' : _pageData.tokenKey
        };
        $.getJSON(_COMMON.context + url, params).done(function(result) {
        	$scope.$apply(function() {
        	    $scope.fieldData = result.configures;
        	    _log(result.configures);
        	});
        });
        
        $("#name").prop("readonly",true);
    }
    

   $scope.save = function() {
       
	var data = $scope.fieldData;
	
	var config = {
	    params : {
		wsname : name=='' ? 'createconfigure':'updateconfigure',
		token : _pageData.tokenKey,
		name : data.name ,
		content : data.content 
	    }
	};
	
	  $http.post(_COMMON.context + url, null, config)
	  .success(function(obj) {
	      notif({
	              msg: "<b><i class='fa fa-thumbs-o-up'></i>  Save Success !</b>",
	              type: "success",
	              position: "center"
	          });
	          $location.path('/admin/configure/list/'); 
          })
          .error(function() {
              alert('Error is occured, May be database connect is wrong');
          });
    };

}
